package com.xintai.approval.Utils;

/**
 * 工具类
 */
public class CommitUtils {
    /**
     * 判断数组相同
     * @return
     */
    public static Boolean arrBaoH(String[] arrays,String[] arr){
        boolean bool = false;
        for (Object array : arrays) {
            for (Object o : arr) {
                if (array.equals(o)){
                    bool = true;
                }
            }
        }
        return bool;
    }

    /***
     * 数组转字符串
     * @param strings
     * @return
     */
    public static String arrToStr(String[] strings){
        String str = "";
        for (String string : strings) {
            str= str + string + ",";
        }
        if (!str.equals("")){
            str = str.substring(0, str.length() - 1);
        }
        return str;
    }

    /***
     * 字符串转数组
     * @param str
     * @return
     */
    public static String[] strToArr(String str){
        String[] split = {};
        try {
            split = str.split(",");
        }catch (Exception e){ }

        return split;

    }
}
